package com.google;

import com.google.way1.Way1Activity;
import com.google.way2.Way2Activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity{
	
	private Button btnWay2, btnWay1;
	
	@Override
	public void onCreate(Bundle b){
		super.onCreate(b);
		setContentView(R.layout.main);
		
		btnWay1 = (Button)this.findViewById(R.id.btn_main_way1);
		btnWay2 = (Button)this.findViewById(R.id.btn_main_way2);
		btnWay1.setOnClickListener(new MyOnClickListener(Way1Activity.class));
		btnWay2.setOnClickListener(new MyOnClickListener(Way2Activity.class));
	}

	class MyOnClickListener  implements OnClickListener{
		Class <? extends Activity> c;
		MyOnClickListener(Class <? extends Activity> c){
			this.c = c;
		}
		@Override
		public void onClick(View v) {
			Intent intent = new Intent(MainActivity.this,c);
			startActivity(intent);
		}
		
	}

}
